package mango.orm.impl;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

import mango.orm.Binder;
import mango.orm.SQLParameter;



public abstract class AbstractBinder implements Binder {
    public void bind(PreparedStatement statement, SQLParameter param)
            throws SQLException {
        this.bind(statement, param.getIndex(), param.getVal(), param.getJdbcType());
    }

    public void bind(PreparedStatement statement, List<SQLParameter> parameters)
            throws SQLException {
        for (SQLParameter sqlParam : parameters) {
            this.bind(statement, sqlParam);
        }
    }

    public abstract void bind(PreparedStatement statement, int index, Object val, int type)
            throws SQLException;
}
